import { TokenType } from "../common";

export type Terminal = TokenType;

export enum NoneTerminal {
  START = 2000,
  // galacean
  gs_shader_program,

  // glsl
  global_declaration,
  variable_declaration,
  variable_declaration_list,
  variable_declaration_statement,
  array_specifier_list,
  array_specifier,
  ext_builtin_type_specifier_nonarray,
  precision_specifier,
  variable_identifier,
  variable_identifier_node,
  primary_expression,
  postfix_expression,
  integer_expression,
  function_call,
  function_call_generic,
  function_call_header_no_parameters,
  function_call_header_with_parameters,
  function_call_parameter_list,
  function_call_header,
  function_identifier,
  constructor_identifier,
  unary_expression,
  unary_operator,
  multiplicative_expression,
  additive_expression,
  shift_expression,
  relational_expression,
  equality_expression,
  and_expression,
  inclusive_or_expression,
  exclusive_or_expression,
  logical_and_expression,
  logical_xor_expression,
  logical_or_expression,
  conditional_expression,
  assignment_expression,
  assignment_operator,
  expression,
  integer_constant_expression,
  integer_constant_expression_operator,
  declaration,
  function_prototype,
  function_declarator,
  function_header_with_parameters,
  function_header,
  function_parameter_list,
  parameter_declarator,
  parameter_declaration,
  parameter_qualifier,
  parameter_type_specifier,
  init_declarator_list,
  single_declaration,
  fully_specified_type,
  type_qualifier,
  single_type_qualifier,
  storage_qualifier,
  precision_qualifier,
  interpolation_qualifier,
  invariant_qualifier,
  type_specifier,
  type_specifier_nonarray,
  type_specifier_no_prec,
  basic_type,
  struct_specifier,
  struct_declaration_list,
  struct_declaration,
  layout_qualifier,
  struct_declarator_list,
  struct_declarator,
  identifier_list,
  decl_identifier,
  initializer,
  initializer_list,
  declaration_statement,
  simple_statement,
  compound_statement_no_scope,
  statement_with_scope,
  compound_statement,
  statement,
  statement_list,
  iteration_statement_no_new_scope,
  expression_statement,
  selection_statement,
  selection_rest_statement,
  condition,
  conditionopt,
  iteration_statement,
  for_init_statement,
  for_rest_statement,
  jump_statement,
  external_declaration,
  function_definition,
  field_selection,
  bool_constant,
  function_identifier_node,
  typename_identifier_node,
  scope_brace,
  scope_end_brace,

  // Macro
  macro_undef,
  macro_push_context,
  macro_pop_context,
  macro_elif_expression,
  macro_else_expression,
  global_macro_if_statement,
  global_macro_declaration,
  global_macro_branch,
  macro_struct_declaration,
  macro_struct_branch,
  macro_if_statement,
  macro_branch,
  macro_param_case_list,
  macro_param_block,
  macro_parameter_branch,
  macro_call_arg_case_list,
  macro_call_arg_block,
  macro_call_arg_branch,

  // Macro call
  macro_call_symbol,
  macro_call_function,

  _ignore
}

export type GrammarSymbol = Terminal | NoneTerminal;

export type Derivation = GrammarSymbol[];
